1. Technical Field
The present invention relates generally to an improved data processing system and in particular to an improved method and apparatus for implementing a shared bus in a data processing system. Still more particularly, the present invention relates to an improved method and apparatus for accommodating multiple interface configurations to a shared bus in a data processing system.
2. Description of the Related Art
Personal computers are becoming even more powerful, reaching levels where they are displacing minicomputers and even mainframe computers. In the process of downsizing, however, connectivity between and/or among personal computers and peripheral devices has evolved as a critical issue. Thus it has become increasingly important to be able to share peripheral devices such as hard drives, printers, scanners, or CD-ROM changers between multiple personal computers, or to be able to attach several peripherals to a single personal computer.
One means for achieving such connectivity is through use of the small computer system interface ("SCSI" or commonly called the "SCSI bus"). The fiber channel bus architecture and other shared bus architectures may also be used. For the purposes of illustrating the invention, the SCSI bus will be referred to as a convenient example of such shared buses.
The SCSI bus is a popular, device independent parallel bus. Various versions of the SCSI standard have been proposed, approved, and/or adopted, including SCSI-1, SCSI-2, and SCSI-3. As used herein, the acronym "SCSI" is used to refer to any of these standards, although the SCSI-3 standard has been selected as exemplary for the purposes of describing the invention. Specifications for these standards may be obtained from the American National Standards Institute, New York, N.Y., as document numbers X3.131-1986 (SCSI-1), X3.131-1994 (SCSI-2), and X3.253-1995 (approved SCSI-3), which are incorporated by reference.
The SCSI standard provides specifications for mechanical, electrical, and functional characteristics of the bus, including definitions of the physical characteristics of the bus conductors, the electrical characteristics of the signals that the conductors carry, and the meanings of those signals (e.g., control or data).
Devices interconnected by a SCSI bus are daisy-chained together using a common 50-conductor cable. The cable comprises nine data conductors (eight for data and one for parity), nine control conductors, and other power and ground conductors. Optionally, a 68-conductor cable may be used to allow wider information transfers (data only) of 16 bits. Typically each conductor is resistively coupled to a voltage of an inactive state. To "assert" a signal onto a conductor, a device must drive the conductor to a voltage of an active state against the resistive coupling of the conductor. If not driven, a conductor will return to its inactive state.
Communication over the SCSI bus is allowed between only two devices at any given time, although up to sixteen devices may be interconnected by the same bus. When two devices communicate on the bus, one acts as an "initiator" and the other acts as a "target." Initiator devices cause target devices on the bus to perform commands whereas target devices perform commands for the initiators. There can be multiple initiators and multiple targets on a SCSI bus. The initiator originates an operation (i.e., requests an I/O process to be performed) and the target performs the operation. Transfers from storage media on a SCSI bus are typically synchronous (although an asynchronous option is defined) and follow a "handshaking" protocol involving the exchange of a "Request" signal from a target and an "Acknowledge" signal from an initiator. This exchange takes place on conductors of the bus that are specifically dedicated to the handshaking task, and is performed in connection with each individual information transfer operation on the SCSI bus.
At a higher logical level, the SCSI standard defines a protocol for managing data transfers on the bus. The protocol comprises various phases, beginning with the SCSI bus in a "bus free phase" in which the SCSI bus is idle. To initiate a data transfer process, the initiator causes the bus to enter an "arbitration bus phase." During the arbitration bus phase, each initiator arbitrates for the bus with the other initiators by asserting the appropriate SCSI bus conductor corresponding with a SCSI identifier (SCSI ID) unique to that specific initiator. Because each SCSI ID has an assigned priority, the initiator with the highest priority will win control of the bus. After winning control of the bus through arbitration, the initiator with the highest priority selects the target device of interest in a "selection bus phase." The initiator controlling the bus asserts its SCSI ID as well as the SCSI ID of the target onto the conductors of the SCSI bus. The target detects its SCSI ID on the bus conductors and responds. In a subsequent "command bus phase," the target requests a SCSI command from the initiator in control of the bus.
At still a higher logical level, the SCSI standard defines a command and status structure. Commands are used by an initiator to request a target to perform particular operations. Each SCSI command, called a SCSI command descriptor block (CDB), consists of multiple bytes, either six, ten, twelve, or sixteen bytes. The command contains information which includes a SCSI operation code indicating the type of operation to be performed. At the completion of a command, or if for some reason a command cannot be completed by the target, the target sends a status byte to the initiator to inform the initiator of its condition.
The specifications of the SCSI standard thus combine to define an interface having multiple protocol levels. The defined interface provides computer systems with device independence within a class of devices. For example, a variety of mass storage devices (such as disk drives, tape drives, optical drives, and memory caches), printers, microprocessors, and other devices may be added to a computer system without requiring modifications to system hardware or software. In addition, special features and functions of individual devices can be handled through the use of device-dependent fields and codes in the command structure.
Hard disk controller host interfaces for target hard disk drives accessed by multiple initiators may automatically transition to a data transfer after being selected. Targets which do not automatically transition to data transfer after being selected normally program the initiator parameters with the DMA context for each command. This does not allow the hardware to be programmed with the appropriate parameters for a new command until the firmware has handled the command interrupt.
Targets which automatically transition to data transfer after being selected usually have N initiator cache entries. Each entry, dedicated to one initiator, specifies all of the required parameters for that initiator. Thus the hardware can be programmed with the appropriate parameters for a new command if the initiator's information is cached in one of the N entries. The trade-off between the number of initiators supported and the number of cache entries requires either a high cost or limiting support to a small number of initiators. Where more initiators are present than can be supported, additional processing overhead in the controller must be expended to swap out initiator information.
It would be desirable, in a target which transitions automatically to data transfer when selected, to support a maximum number of initiators while minimizing the additional architectural and processing overhead required.